package cn.cy.dao.orclimpl;

import cn.cy.dao.BaseDao;
import cn.cy.dao.CheckResultDao;
import cn.cy.pojo.BizCheckResult;
import cn.cy.pojo.SysEmployee;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository("checkResultDao")
public class CheckResultDaoImpl extends BaseDao<BizCheckResult> implements CheckResultDao {
    public CheckResultDaoImpl(){}
    @Autowired
    public CheckResultDaoImpl(@Qualifier("sessionFactory") SessionFactory sessionFactory){
        setSessionFactory(sessionFactory);
    }

    public List<BizCheckResult> findById(Long id) {
        return this.getHibernateTemplate().find("from BizCheckResult where id="+id);
    }

    @Override
    public List<BizCheckResult> findByClaimId(Long claimId) {
        return this.getHibernateTemplate().find("from BizCheckResult where claimId="+claimId);
    }

    @Override
    public List<BizCheckResult> findByCheckId(SysEmployee employee) {
        return this.getHibernateTemplate().find("from BizCheckResult where employee="+employee);
    }
}
